defaultOptions = varargin2struct(defaultOptions,ValidProps,... PROPERTY1,VALUE1,PROPERTY2,VALUE2,...) defaultOptions = varargin2struct(defaultOptions,ValidProps,... PROPERTY1,VALUE1,OPTSTRUCT,...)
Convert parameter-value combinations to structure
defaultOptions | any | Struct with default values |
ValidProps | any | Allowable fields (cell array) PROPERTY,VALUE: Property-Value pairs, and/or OPTSTRUCT: Option structure that stores property value pairs +----PROPERTY1=VALUE1 +----PROPERTY2=VALUE2 |
Options | any | structure identical to defaultOptions, but appriate fields over overwritten with property value pairs. |
function do_some(varargin) defaultOptions=struct('a',1,'b',2); Options=varargin2struct(defaultOptions,fieldnames(defaultOptions),varargin{:}); Copyright 2006-2022 Modelit, www.modelit.nl